package com.tscnd.core.service.user.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tscnd.core.entity.user.User;
import com.tscnd.core.exception.ServerException;
import com.tscnd.core.redis.RedisClientTemplate;
import com.tscnd.core.service.user.IUserService;

@Service("userService")
public class UserServiceImpl implements IUserService{
	
	@Autowired
	private RedisClientTemplate redisClientTemplate;
	
	@Override
	public User findUserByUsernmae(String username)throws ServerException {
		
		if("xiangt".equals(username)){
			User user=new User();
			user.setUsername("username");
			user.setPassword("e10adc3949ba59abbe56e057f20f883e");
			return user;
		}
		return null;
	}
	
	public void ridesSetUser(){
		redisClientTemplate.set("xiangt", "tao");
	}

}
